@use '@scss/common' as *;
@use '../shared.scss';

.checkbox {
  position: relative;
}

.button {
  all: unset;
  display: flex;
  align-items: center;
  cursor: pointer;
  // font-family: $fontBody;
  font-size: 1rem;
  color: var(--color-text);

  &:disabled {
    color: var(--theme-elevation-500);
  }

  &:focus,
  &:active {
    outline: none;
  }

  &:focus-visible {
    .input {
      @include outline;
    }
  }

  &:hover {
    :local() {
      .icon {
        opacity: 0.2;
      }
    }
  }
}

.htmlInput {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}

.errorWrap {
  position: relative;
}

.input {
  @include shared.formInput;
  & {
    padding: 0;
    line-height: 0;
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

.icon {
  opacity: 0;
}

.checked {
  :local() {
    .icon {
      opacity: 1 !important;
    }
  }
}

.checkbox .label {
  @include body;
  & {
    cursor: pointer;
    margin-bottom: 0;
  }
}

:global([data-theme='light']) {
  .input {
    background: var(--theme-elevation-50);
  }
}
